package ooday05;
/** 枚举的演示 */
public class EnumDemo {
    public static void main(String[] args) {
//        Season s = Season.SUMMER;//获取SUMMER对象
//        System.out.println(s.getSeasonName());
        Season[] season = Season.values();//获取所有枚举的对象
        for(int i = 0;i<season.length;i++){
            System.out.println(season[i]);//输出四个枚举SUMMER...
            System.out.println(season[i].getSeasonName());//输出枚举的名字属性
            System.out.println(season[i].getSeasonDesc());//输出枚举特性属性
        }
        Season s1 = Season.AUTUMN;//获取AUTUMN对象
        //System.out.println(s1.getSeasonName()+","+s1.getSeasonDesc());
        switch(s1){
            case SPRING:
                System.out.println("天气"+s1.getSeasonDesc()+",放风筝去咯！");
                break;
            case SUMMER:
                System.out.println("天气"+s1.getSeasonDesc()+",游泳去喽！");
                break;
            case AUTUMN:
                System.out.println("天气"+s1.getSeasonDesc()+",摘苹果去喽！");
                break;
            case WINTER:
                System.out.println("天气"+s1.getSeasonDesc()+",打雪仗去喽！");
                break;
        }
    }
}
